package com.caiyigo.baihua.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Repository;

import com.caiyigo.baihua.dto.KaoshicjDto;
import com.caiyigo.baihua.dto.KaoshikemuDto;
import com.caiyigo.baihua.dto.KaoshizwDto;
import com.caiyigo.baihua.dto.KaoshizwDto;
import com.caiyigo.baihua.model.Kaoshikemu;
import com.caiyigo.baihua.model.Kaoshizw;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;

/**
 * @author Administrator
 * 
 */
@Repository
public class KaoshikemuMapperSql implements KaoshikemuMapper {
	private SqlSessionFactory sqlSessionFactory;

	public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
		this.sqlSessionFactory = sqlSessionFactory;
	}

	public List getList(Kaoshikemu dto, PageBounds pageBounds) {

		Map<String, Object> params = new HashMap<String, Object>();

		if (!StringUtils.isEmpty(dto.getKmDm())) {
			params.put(KaoshikemuDto.FileConstant.kmDm, dto.getKmDm());
		}
		if (!StringUtils.isEmpty(dto.getKmMc())) {
			params.put(KaoshikemuDto.FileConstant.kmMc, dto.getKmMc());
		}

		List<Object> list = null;
		SqlSession session = sqlSessionFactory.openSession();
		try {
			list = session.selectList(
					"com.caiyigo.baihua.dao.KaoshikemuMapper.list", params,
					pageBounds);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}

		return list;
	}

	@Override
	public int deleteByPrimaryKey(String kmDm) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insert(Kaoshikemu record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insertSelective(Kaoshikemu record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Kaoshikemu selectByPrimaryKey(String kmDm) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int updateByPrimaryKeySelective(Kaoshikemu record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKey(Kaoshikemu record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int batchDelete(String[] ids) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<Kaoshikemu> getAll() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int batchUpdate(List<Kaoshikemu> record) {
		// TODO Auto-generated method stub
		return 0;
	}

}